\(\int \frac {\sin ^4(x)}{i+\tan (x)} \, dx\) [1]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [F(-2)]
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 13, antiderivative size = 78 \[ \int \frac {\sin ^4(x)}{i+\tan (x)} \, dx=-\frac {i x}{16}-\frac {1}{32 (i-\tan (x))^2}-\frac {i}{8 (i-\tan (x))}+\frac {i}{24 (i+\tan (x))^3}-\frac {5}{32 (i+\tan (x))^2}-\frac {3 i}{16 (i+\tan (x))} \]

[Out]

-1/16*I*x-1/32/(I-tan(x))^2-1/8*I/(I-tan(x))+1/24*I/(I+tan(x))^3-5/32/(I+tan(x))^2-3/16*I/(I+tan(x))

Rubi [A] (verified)

Time = 0.11 (sec) , antiderivative size = 78, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.308, Rules used = {3597, 862, 90, 209} \[ \int \frac {\sin ^4(x)}{i+\tan (x)} \, dx=-\frac {i x}{16}-\frac {i}{8 (-\tan (x)+i)}-\frac {3 i}{16 (\tan (x)+i)}-\frac {1}{32 (-\tan (x)+i)^2}-\frac {5}{32 (\tan (x)+i)^2}+\frac {i}{24 (\tan (x)+i)^3} \]

[In]

Int[Sin[x]^4/(I + Tan[x]),x]

[Out]

(-1/16*I)*x - 1/(32*(I - Tan[x])^2) - (I/8)/(I - Tan[x]) + (I/24)/(I + Tan[x])^3 - 5/(32*(I + Tan[x])^2) - ((3
*I)/16)/(I + Tan[x])

Rule 90

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandI
ntegrand[(a + b*x)^m*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, p}, x] && IntegersQ[m, n] &&
(IntegerQ[p] || (GtQ[m, 0] && GeQ[n, -1]))

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 862

Int[((d_) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[(d + e*x)
^(m + p)*(f + g*x)^n*(a/d + (c/e)*x)^p, x] /; FreeQ[{a, c, d, e, f, g, m, n}, x] && NeQ[e*f - d*g, 0] && EqQ[c
*d^2 + a*e^2, 0] && (IntegerQ[p] || (GtQ[a, 0] && GtQ[d, 0] && EqQ[m + p, 0]))

Rule 3597

Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[b/f, Subst[Int
[x^m*((a + x)^n/(b^2 + x^2)^(m/2 + 1)), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[m/
2]

Rubi steps \begin{align*} \text {integral}& = \text {Subst}\left (\int \frac {x^4}{(i+x) \left (1+x^2\right )^3} \, dx,x,\tan (x)\right ) \\ & = \text {Subst}\left (\int \frac {x^4}{(-i+x)^3 (i+x)^4} \, dx,x,\tan (x)\right ) \\ & = \text {Subst}\left (\int \left (\frac {1}{16 (-i+x)^3}-\frac {i}{8 (-i+x)^2}-\frac {i}{8 (i+x)^4}+\frac {5}{16 (i+x)^3}+\frac {3 i}{16 (i+x)^2}-\frac {i}{16 \left (1+x^2\right )}\right ) \, dx,x,\tan (x)\right ) \\ & = -\frac {1}{32 (i-\tan (x))^2}-\frac {i}{8 (i-\tan (x))}+\frac {i}{24 (i+\tan (x))^3}-\frac {5}{32 (i+\tan (x))^2}-\frac {3 i}{16 (i+\tan (x))}-\frac {1}{16} i \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (x)\right ) \\ & = -\frac {i x}{16}-\frac {1}{32 (i-\tan (x))^2}-\frac {i}{8 (i-\tan (x))}+\frac {i}{24 (i+\tan (x))^3}-\frac {5}{32 (i+\tan (x))^2}-\frac {3 i}{16 (i+\tan (x))} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.11 (sec) , antiderivative size = 67, normalized size of antiderivative = 0.86 \[ \int \frac {\sin ^4(x)}{i+\tan (x)} \, dx=\frac {\sec (x) (-56 i \cos (x)-9 i \cos (3 x)+i \cos (5 x)+24 \arctan (\tan (x)) (\cos (x)-i \sin (x))-32 \sin (x)-27 \sin (3 x)+5 \sin (5 x))}{384 (i+\tan (x))} \]

[In]

Integrate[Sin[x]^4/(I + Tan[x]),x]

[Out]

(Sec[x]*((-56*I)*Cos[x] - (9*I)*Cos[3*x] + I*Cos[5*x] + 24*ArcTan[Tan[x]]*(Cos[x] - I*Sin[x]) - 32*Sin[x] - 27
*Sin[3*x] + 5*Sin[5*x]))/(384*(I + Tan[x]))

Maple [A] (verified)

Time = 35.65 (sec) , antiderivative size = 39, normalized size of antiderivative = 0.50

method result size
risch \(-\frac {i x}{16}-\frac {{\mathrm e}^{6 i x}}{192}+\frac {\cos \left (4 x \right )}{32}+\frac {i \sin \left (4 x \right )}{64}-\frac {5 \cos \left (2 x \right )}{64}+\frac {i \sin \left (2 x \right )}{64}\) \(39\)
parallelrisch \(-\frac {7}{480}-\frac {i x}{12}+\ln \left (\frac {1}{\left (i+\tan \left (x \right )\right )^{\frac {1}{48}}}\right )+\ln \left (\left (\sec ^{2}\left (x \right )\right )^{\frac {1}{96}}\right )+\frac {i \sin \left (2 x \right )}{64}-\frac {i \sin \left (6 x \right )}{192}+\frac {i \sin \left (4 x \right )}{64}-\frac {\cos \left (6 x \right )}{192}+\frac {\cos \left (4 x \right )}{32}-\frac {5 \cos \left (2 x \right )}{64}\) \(61\)
default \(\frac {i}{8 \tan \left (x \right )-8 i}-\frac {1}{32 \left (\tan \left (x \right )-i\right )^{2}}-\frac {\ln \left (\tan \left (x \right )-i\right )}{32}+\frac {i}{24 \left (i+\tan \left (x \right )\right )^{3}}-\frac {3 i}{16 \left (i+\tan \left (x \right )\right )}-\frac {5}{32 \left (i+\tan \left (x \right )\right )^{2}}+\frac {\ln \left (i+\tan \left (x \right )\right )}{32}\) \(66\)

[In]

int(sin(x)^4/(I+tan(x)),x,method=_RETURNVERBOSE)

[Out]

-1/16*I*x-1/192*exp(6*I*x)+1/32*cos(4*x)+1/64*I*sin(4*x)-5/64*cos(2*x)+1/64*I*sin(2*x)

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 39, normalized size of antiderivative = 0.50 \[ \int \frac {\sin ^4(x)}{i+\tan (x)} \, dx=\frac {1}{384} \, {\left (-24 i \, x e^{\left (4 i \, x\right )} - 2 \, e^{\left (10 i \, x\right )} + 9 \, e^{\left (8 i \, x\right )} - 12 \, e^{\left (6 i \, x\right )} - 18 \, e^{\left (2 i \, x\right )} + 3\right )} e^{\left (-4 i \, x\right )} \]

[In]

integrate(sin(x)^4/(I+tan(x)),x, algorithm="fricas")

[Out]

1/384*(-24*I*x*e^(4*I*x) - 2*e^(10*I*x) + 9*e^(8*I*x) - 12*e^(6*I*x) - 18*e^(2*I*x) + 3)*e^(-4*I*x)

Sympy [A] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 51, normalized size of antiderivative = 0.65 \[ \int \frac {\sin ^4(x)}{i+\tan (x)} \, dx=- \frac {i x}{16} - \frac {e^{6 i x}}{192} + \frac {3 e^{4 i x}}{128} - \frac {e^{2 i x}}{32} - \frac {3 e^{- 2 i x}}{64} + \frac {e^{- 4 i x}}{128} \]

[In]

integrate(sin(x)**4/(I+tan(x)),x)

[Out]

-I*x/16 - exp(6*I*x)/192 + 3*exp(4*I*x)/128 - exp(2*I*x)/32 - 3*exp(-2*I*x)/64 + exp(-4*I*x)/128

Maxima [F(-2)]

Exception generated. \[ \int \frac {\sin ^4(x)}{i+\tan (x)} \, dx=\text {Exception raised: RuntimeError} \]

[In]

integrate(sin(x)^4/(I+tan(x)),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: expt: undefined: 0 to a negative exponent.

Giac [A] (verification not implemented)

none

Time = 0.33 (sec) , antiderivative size = 53, normalized size of antiderivative = 0.68 \[ \int \frac {\sin ^4(x)}{i+\tan (x)} \, dx=-\frac {3 i \, \tan \left (x\right )^{4} + 21 \, \tan \left (x\right )^{3} + 13 i \, \tan \left (x\right )^{2} + 11 \, \tan \left (x\right ) + 8 i}{48 \, {\left (\tan \left (x\right ) + i\right )}^{3} {\left (\tan \left (x\right ) - i\right )}^{2}} + \frac {1}{32} \, \log \left (\tan \left (x\right ) + i\right ) - \frac {1}{32} \, \log \left (\tan \left (x\right ) - i\right ) \]

[In]

integrate(sin(x)^4/(I+tan(x)),x, algorithm="giac")

[Out]

-1/48*(3*I*tan(x)^4 + 21*tan(x)^3 + 13*I*tan(x)^2 + 11*tan(x) + 8*I)/((tan(x) + I)^3*(tan(x) - I)^2) + 1/32*lo
g(tan(x) + I) - 1/32*log(tan(x) - I)

Mupad [B] (verification not implemented)

Time = 4.71 (sec) , antiderivative size = 49, normalized size of antiderivative = 0.63 \[ \int \frac {\sin ^4(x)}{i+\tan (x)} \, dx=-\frac {x\,1{}\mathrm {i}}{16}+\frac {\frac {{\mathrm {tan}\left (x\right )}^4\,1{}\mathrm {i}}{16}+\frac {7\,{\mathrm {tan}\left (x\right )}^3}{16}+\frac {{\mathrm {tan}\left (x\right )}^2\,13{}\mathrm {i}}{48}+\frac {11\,\mathrm {tan}\left (x\right )}{48}+\frac {1}{6}{}\mathrm {i}}{{\left (\mathrm {tan}\left (x\right )+1{}\mathrm {i}\right )}^3\,{\left (1+\mathrm {tan}\left (x\right )\,1{}\mathrm {i}\right )}^2} \]

[In]

int(sin(x)^4/(tan(x) + 1i),x)

[Out]

((11*tan(x))/48 + (tan(x)^2*13i)/48 + (7*tan(x)^3)/16 + (tan(x)^4*1i)/16 + 1i/6)/((tan(x) + 1i)^3*(tan(x)*1i +
 1)^2) - (x*1i)/16